//
//  Demo2.hpp
//  OpenGLDemo1
//
//  Created by HFY on 2018/6/21.
//  Copyright © 2018年 Demo. All rights reserved.
//

#ifndef Demo2_hpp
#define Demo2_hpp

#include <glad/glad.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "Shader.hpp"

class Demo2 {
public:
    Demo2();
    void draw();
    void moveForward();
    void moveBack();
    void moveLeft();
    void moveRight();
    void update(float pitch, float yaw);
    void zoomWith(float offset);
private:
    Shader *shader;
    GLuint texture0, texture1;
    GLuint VBO, VAO, EBO;
    glm::mat4 transform;
    
    glm::vec3 cameraPosition;
    glm::vec3 cameraFront;
    glm::vec3 cameraUp;
    float cameraSpeed = 0.15f;
    float fov = 45.f;
    
    void updateTranform(int i);
};


#endif /* Demo2_hpp */
